home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 2000 February: Tool Chest / Dev.CD Feb 00 TC.toast / pc / tool chest / development kits / hypercard related / xcmds & xfcns / progresswindoidÑc / progresswindoid / stack_-1.xml < prev    next >
Encoding:
Extensible Markup Language  |  1992-01-15  |  6.1 KB  |  21 lines

  1. <?xml version="1.0" encoding="utf-8" ?>
  2. <!DOCTYPE stack PUBLIC "-//Apple, Inc.//DTD stack V 2.0//EN" "" >
  3. <stack>
  4.     <name>in</name>
  5.     <id>-1</id>
  6.     <cardCount>2</cardCount>
  7.     <cardID>3591</cardID>
  8.     <listID>3283</listID>
  9.     <cantModify><false /></cantModify>
  10.     <cantDelete><false /></cantDelete>
  11.     <cantAbort><false /></cantAbort>
  12.     <cardSize>
  13.         <width>512</width>
  14.         <height>342</height>
  15.     </cardSize>
  16.     <script>‚Ä¢‚Ä¢‚Ä¢‚Ä¢‚Ä¢ System Messages ‚Ä¢‚Ä¢‚Ä¢‚Ä¢‚Ä¢
  17.  
  18. on openCard
  19. ShowCdNumInBackground "Card Number"
  20. pass openCard
  21. end openCard
  22.  
  23. on closeCard
  24. lock screen
  25. pass closeCard
  26. end closeCard
  27.  
  28. ‚Ä¢‚Ä¢‚Ä¢‚Ä¢‚Ä¢ Label Field Package ‚Ä¢‚Ä¢‚Ä¢‚Ä¢‚Ä¢
  29.  
  30. on LabelFieldClick
  31. if the commandKey is not down then exit LabelFieldClick
  32. put the locktext of the target into OldLocked
  33. set the locktext of the target to not (OldLocked)
  34. if OldLocked is true then play harpsichord "c5s" -- it‚Äôs unlocked now; high tone
  35. else play harpsichord "c4s"                      -- it‚Äôs locked now; low tone
  36. end LabelFieldClick
  37.  
  38. ‚Ä¢‚Ä¢‚Ä¢‚Ä¢‚Ä¢ Card Number Display Package ‚Ä¢‚Ä¢‚Ä¢‚Ä¢‚Ä¢
  39.  
  40. on ShowCdNumInBackground FieldName
  41. if there is a bg field FieldName
  42. then put CdNumInBackground() into bg field FieldName
  43. else if there is a card field FieldName
  44. then put CdNumInBackground() into card field FieldName
  45. end ShowCdNumInBackground
  46.  
  47. on ShowCdNumInStack FieldName
  48. if there is a bg field FieldName
  49. then put CdNumInStack() into bg field FieldName
  50. else if there is a card field FieldName
  51. then put CdNumInStack() into card field FieldName
  52. end ShowCdNumInStack
  53.  
  54. function CdNumInBackground -- assumes cards of current bg are together
  55. put the number of cards in this bg into NumCards
  56. put the number of card 1 of this background into FirstCard
  57. put the number of this card into ThisCard
  58. return "Card" && (ThisCard - FirstCard + 1) && "of" && NumCards
  59. end CdNumInBackground
  60.  
  61. function CdNumInStack
  62. put the number of cards in this stack into NumCards
  63. put the number of this card into ThisCard
  64. return "Card" && ThisCard && "of" && NumCards
  65. end CdNumInStack
  66.  
  67.  
  68. ‚Ä¢‚Ä¢‚Ä¢‚Ä¢‚Ä¢ Valid Entry Package
  69. ‚Ä¢‚Ä¢‚Ä¢‚Ä¢‚Ä¢ Version 1.3 -- For use with for HyperCard 2.0 and later.
  70. ‚Ä¢‚Ä¢‚Ä¢‚Ä¢‚Ä¢ September 18, 1990
  71. ‚Ä¢‚Ä¢‚Ä¢‚Ä¢‚Ä¢ By Chris Thorman, Apple Computer, Inc.
  72. •••••
  73. ‚Ä¢‚Ä¢‚Ä¢‚Ä¢‚Ä¢ Freeware, but please include the first six lines of this message.
  74.  
  75. on StartValidatedEntry
  76. global ValidValueOnEntry
  77. global ValidationEnabled
  78.  
  79. put target into ValidValueOnEntry
  80. put true into ValidationEnabled
  81. end StartValidatedEntry
  82.  
  83. on CancelValidation FieldNames
  84. global ValidationEnabled
  85. if (FieldNames is empty) or (the selectedField is empty) then
  86. put false into ValidationEnabled
  87. else
  88. put the short name of the selectedField into SelectedName
  89. repeat with FieldNum = 1 to the number of items in FieldNames
  90. if item FieldNum of FieldNames is SelectedName
  91. then
  92. put false into ValidationEnabled
  93. end if
  94. end repeat
  95. end if
  96. end CancelValidation
  97.  
  98. on ReEnableValidation
  99. global ValidationEnabled
  100. put true into ValidationEnabled
  101. end ReEnableValidation
  102.  
  103. on ValidateNumberEntry LowBound, HighBound
  104. global ValidationEnabled
  105. if ValidationEnabled is false then exit ValidateNumberEntry
  106. else
  107. put target into NewValue
  108.  
  109. if LowBound is empty then put NewValue into LowBound
  110. if HighBound is empty then put NewValue into HighBound
  111.  
  112. if NewValue is not a number ¬¨
  113. or NewValue < LowBound ¬¨
  114. or NewValue > HighBound ¬¨
  115. then
  116. ResetToValidValue
  117. end if
  118. end if
  119. end ValidateNumberEntry
  120.  
  121. on ValidateIntegerEntry LowBound, HighBound
  122. global ValidationEnabled
  123. if ValidationEnabled is false then exit ValidateIntegerEntry
  124. else
  125. put target into NewValue
  126. if LowBound is empty then put NewValue into LowBound
  127. if HighBound is empty then put NewValue into HighBound
  128.  
  129. if NewValue is not an integer ¬¨
  130. or NewValue < LowBound ¬¨
  131. or NewValue > HighBound ¬¨
  132. then
  133. ResetToValidValue
  134. end if
  135. end if
  136. end ValidateIntegerEntry
  137.  
  138. on ValidateDateEntry LowBound, HighBound
  139. global ValidationEnabled
  140. if ValidationEnabled is false then exit ValidateDateEntry
  141. else
  142. put target into NewValue
  143.  
  144. if LowBound is empty then put NewValue into LowBound
  145. if HighBound is empty then put NewValue into HighBound
  146.  
  147. if NewValue is not a date ¬¨
  148. or NewValue < LowBound ¬¨
  149. or NewValue > HighBound ¬¨
  150. then
  151. ResetToValidValue
  152. end if
  153. end if
  154. end ValidateDateEntry
  155.  
  156. on ValidateNonEmptyEntry
  157. global ValidationEnabled
  158. if ValidationEnabled is false then exit ValidateNonEmptyEntry
  159. else
  160. put target into NewValue
  161.  
  162. if NewValue is empty ¬¨
  163. then
  164. ResetToValidValue
  165. end if
  166. end if
  167. end ValidateNonEmptyEntry
  168.  
  169. on ValidateArbitraryEntry
  170. global ValidationEnabled
  171. if ValidationEnabled is false then exit ValidateArbitraryEntry
  172. else
  173. send "DoArbitraryValidation" to the target
  174. end if
  175. end ValidateArbitraryEntry
  176.  
  177. on DoArbitraryValidation
  178. ResetToValidValue
  179. end DoArbitraryValidation
  180.  
  181. on DoUserExplanation TheReplacementValue
  182. -- This behavior is often overridden by particular fields
  183. answer "The value ‚Äú" & target & "‚Äù is invalid.  The value ‚Äú" & ¬¨
  184. TheReplacementValue & "‚Äù will be kept."
  185. end DoUserExplanation
  186.  
  187. on KeepOnlyFirstWord
  188. put word 1 of target into the target
  189. end KeepOnlyFirstWord
  190.  
  191. on KeepOnlyFirstLine
  192. put line 1 of target into the target
  193. end KeepOnlyFirstLine
  194.  
  195. on KeepOnlyVisibleLines
  196. put the height of the target into FieldHeight
  197. put the textHeight of the target into LineHeight
  198. put trunc(FieldHeight/LineHeight) into NumVisibleLines
  199. put line 1 to NumVisibleLines of target into the target
  200. end KeepOnlyVisibleLines
  201.  
  202. on UseTextStyleOfField
  203. get target
  204. put it into the target
  205. end UseTextStyleOfField
  206.  
  207. on RemoveTrailingZeroes
  208. put target into Val
  209. if Val is an integer then
  210. put the numberFormat into OldFormat
  211. set the numberFormat to 0
  212. put Val + 0 into Val
  213. set the numberFormat to OldFormat
  214. put Val into the target
  215. end if
  216. end RemoveTrailingZeroes
  217.  
  218. on ResetToValidValue
  219. global ValidValueOnEntry
  220. put line 1 of ValidValueOnEntry into ReplaceText
  221. send "DoUserExplanation" && quote & ReplaceText & quote to the target
  222. put ValidValueOnEntry into the target
  223. end ResetToValidValue
  224.  
  225. </script>
  226.     <background id="4419" file="background_4419.xml" name="" />
  227.     <card id="3591" file="card_3591.xml" marked="false" name="" owner="4419" />
  228.     <card id="3903" file="card_3903.xml" marked="false" name="" owner="4419" />
  229. </stack>
  230.